/**
 * json配置举例，更多配置请看 IConfigSchema
 * @author luguoxiang
 * @date 2022/7/5
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
import { IConfigSchema } from '@/soar';
import { basePath } from '../api';
import { MenuComponent } from '@/types/interface';

const fieldList: IConfigSchema<any>[] = [
  {
    field: 'propName',
    label: '流程名称',
    dataType: 'string',
  },
  {
    field: 'startTime',
    label: '流程开始时间',
    dataType: 'datetime',
    table: {
      width: 160,
    },
    search: {
      slots: 'startTime',
    },
    form: false,
  },
  {
    field: 'endTime',
    label: '流程结束时间',
    dataType: 'datetime',
    table: {
      width: 160,
    },
    search: {
      slots: 'endTime',
    },
    form: false,
  },
  {
    field: 'status',
    label: '流程状态',
    table: {
      width: 80,
      cell(_, { row }) {
        return row.endTime ? '已结束' : '进行中';
      },
    },
    search: false,
    form: false,
  },
];

export default fieldList;

/**
 * 组件配置（用于生成菜单数据）
 */
export const COMPONENTS: MenuComponent[] = [
  {
    title: '抄送我的',
    component: () => import('./List.vue'),
    sort: 20,
    keepalive: true,
    icon: 'user',
    permits: [
      `GET${basePath}/cc`,
      `GET${basePath}/taskDetail`,
      `GET${basePath}/progress`,
      `GET${basePath}/auditLog`,
      `GET${basePath}/auditLog2`,
    ],
    elements: [],
  },
];
